﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;

namespace Eniux.Windows.ThreeDEngine.AttachObject
{
   public class AttachViewCube:AttachBase
    {
       #region Face(面)
        /// <summary>
        /// ViewBox的面属性
        /// </summary>
       public static readonly DependencyProperty FaceProperty = DependencyProperty.RegisterAttached("Face", typeof(Face), typeof(AttachViewCube), new PropertyMetadata(Face.None));

        /// <summary>
       /// 设置给定依赖对象的Face附加属性的值
        /// </summary>
        /// <param name="element">依赖对象</param>
        /// <param name="value">值</param>
       public static void SetFace(DependencyObject element, Face value)
        {
            element.SetValue(FaceProperty, value);
        }

        /// <summary>
       /// 获取给定依赖对象的Face附加属性的值
        /// </summary>
        /// <param name="element">依赖对象</param>
       /// <returns>Face附加属性的值</returns>
       public static Face GetFace(DependencyObject element)
        {
            return (Face)element.GetValue(FaceProperty);
        }
        #endregion

       #region Alignment(面)
       /// <summary>
       /// ViewBox的对齐属性
       /// </summary>
       public static readonly DependencyProperty AlignmentProperty = DependencyProperty.RegisterAttached("Alignment", typeof(Alignment), typeof(AttachViewCube), new PropertyMetadata(Alignment.None));

       /// <summary>
       /// 设置给定依赖对象的Alignment附加属性的值
       /// </summary>
       /// <param name="element">依赖对象</param>
       /// <param name="value">值</param>
       public static void SetAlignment(DependencyObject element, Alignment value)
       {
           element.SetValue(AlignmentProperty, value);
       }

       /// <summary>
       /// 获取给定依赖对象的Alignment附加属性的值
       /// </summary>
       /// <param name="element">依赖对象</param>
       /// <returns>Alignment附加属性的值</returns>
       public static Alignment GetAlignment(DependencyObject element)
       {
           return (Alignment)element.GetValue(AlignmentProperty);
       }
       #endregion

       #region TopText(顶视图文本)
       /// <summary>
       /// 顶视图文本属性
       /// </summary>
       public static readonly DependencyProperty TopTextProperty = DependencyProperty.RegisterAttached("TopText", typeof(string), typeof(AttachViewCube), new PropertyMetadata("上"));
      
       /// <summary>
       /// 设置给定依赖对象的TopText附加属性的值
       /// </summary>
       /// <param name="element">依赖对象</param>
       /// <param name="value">值</param>
       public static void SetTopText(DependencyObject element, string value)
        {
            element.SetValue(TopTextProperty, value);
        }

       /// <summary>
       /// 获取给定依赖对象的TopText附加属性的值
       /// </summary>
       /// <param name="element">依赖对象</param>
       /// <returns>TopText附加属性的值</returns>
       public static string GetTopText(DependencyObject element)
        {
            return (string)element.GetValue(TopTextProperty);
        }
        #endregion

       #region BottomText(底视图文本)
       /// <summary>
       /// 底视图文本属性
       /// </summary>
       public static readonly DependencyProperty BottomTextProperty = DependencyProperty.RegisterAttached("BottomText", typeof(string), typeof(AttachViewCube), new PropertyMetadata("下"));

       /// <summary>
       /// 设置给定依赖对象的BottomText附加属性的值
       /// </summary>
       /// <param name="element">依赖对象</param>
       /// <param name="value">值</param>
       public static void SetBottomText(DependencyObject element, string value)
       {
           element.SetValue(BottomTextProperty, value);
       }

       /// <summary>
       /// 获取给定依赖对象的BottomText附加属性的值
       /// </summary>
       /// <param name="element">依赖对象</param>
       /// <returns>BottomText附加属性的值</returns>
       public static string GetBottomText(DependencyObject element)
       {
           return (string)element.GetValue(BottomTextProperty);
       }
       #endregion

       #region FrontText(前视图文本)
       /// <summary>
       /// 前视图文本属性
       /// </summary>
       public static readonly DependencyProperty FrontTextProperty = DependencyProperty.RegisterAttached("FrontText", typeof(string), typeof(AttachViewCube), new PropertyMetadata("前"));

       /// <summary>
       /// 设置给定依赖对象的FrontText附加属性的值
       /// </summary>
       /// <param name="element">依赖对象</param>
       /// <param name="value">值</param>
       public static void SetFrontText(DependencyObject element, string value)
       {
           element.SetValue(FrontTextProperty, value);
       }

       /// <summary>
       /// 获取给定依赖对象的FrontText附加属性的值
       /// </summary>
       /// <param name="element">依赖对象</param>
       /// <returns>FrontText附加属性的值</returns>
       public static string GetFrontText(DependencyObject element)
       {
           return (string)element.GetValue(FrontTextProperty);
       }
       #endregion

       #region BackText(后视图文本)
       /// <summary>
       /// 后视图文本属性
       /// </summary>
       public static readonly DependencyProperty BackTextProperty = DependencyProperty.RegisterAttached("BackText", typeof(string), typeof(AttachViewCube), new PropertyMetadata("后"));

       /// <summary>
       /// 设置给定依赖对象的BackText附加属性的值
       /// </summary>
       /// <param name="element">依赖对象</param>
       /// <param name="value">值</param>
       public static void SetBackText(DependencyObject element, string value)
       {
           element.SetValue(BackTextProperty, value);
       }

       /// <summary>
       /// 获取给定依赖对象的BackText附加属性的值
       /// </summary>
       /// <param name="element">依赖对象</param>
       /// <returns>BackText附加属性的值</returns>
       public static string GetBackText(DependencyObject element)
       {
           return (string)element.GetValue(BackTextProperty);
       }
       #endregion

       #region LeftText(左视图文本)
       /// <summary>
       /// 左视图文本属性
       /// </summary>
       public static readonly DependencyProperty LeftTextProperty = DependencyProperty.RegisterAttached("LeftText", typeof(string), typeof(AttachViewCube), new PropertyMetadata("左"));

       /// <summary>
       /// 设置给定依赖对象的LeftText附加属性的值
       /// </summary>
       /// <param name="element">依赖对象</param>
       /// <param name="value">值</param>
       public static void SetLeftText(DependencyObject element, string value)
       {
           element.SetValue(LeftTextProperty, value);
       }

       /// <summary>
       /// 获取给定依赖对象的LeftText附加属性的值
       /// </summary>
       /// <param name="element">依赖对象</param>
       /// <returns>LeftText附加属性的值</returns>
       public static string GetLeftText(DependencyObject element)
       {
           return (string)element.GetValue(LeftTextProperty);
       }
       #endregion

       #region RightText(右视图文本)
       /// <summary>
       /// 左视图文本属性
       /// </summary>
       public static readonly DependencyProperty RightTextProperty = DependencyProperty.RegisterAttached("RightText", typeof(string), typeof(AttachViewCube), new PropertyMetadata("右"));

       /// <summary>
       /// 设置给定依赖对象的RightText附加属性的值
       /// </summary>
       /// <param name="element">依赖对象</param>
       /// <param name="value">值</param>
       public static void SetRightText(DependencyObject element, string value)
       {
           element.SetValue(RightTextProperty, value);
       }

       /// <summary>
       /// 获取给定依赖对象的RightText附加属性的值
       /// </summary>
       /// <param name="element">依赖对象</param>
       /// <returns>RightText附加属性的值</returns>
       public static string GetRightText(DependencyObject element)
       {
           return (string)element.GetValue(RightTextProperty);
       }
       #endregion

       public  static void AddOwner(Type ty)
       {
           AttachViewCube.TopTextProperty.AddOwner(ty);
           AttachViewCube.BottomTextProperty.AddOwner(ty);
           AttachViewCube.FrontTextProperty.AddOwner(ty);
           AttachViewCube.BackTextProperty.AddOwner(ty);
           AttachViewCube.LeftTextProperty.AddOwner(ty);
           AttachViewCube.RightTextProperty.AddOwner(ty);
       }
    }
   public enum Alignment
   {
       None,
       Top,
       TopLeft,
       TopRight,
       Left,
       Center,
       Right,
       BottomLeft,
       Bottom,
       BottomRight,
       Stretch
   }
   public enum Face
   {
       None,
       Top,
       Bottom,
       Left,
       Right,
       Front,
       Back,
   }
}
